<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="application/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.js"></script>
</head>
<body>
<p th:text="'Hello, ' + ${user} + '!'" />
<button onclick="selectUserById()">根据用户ID获取用户信息</button>
<script>
    function selectUserById() {
        //jQuery.get(url, [data], [callback], [type])
        var url = "http://localhost:8081/iController/selectUser"
        jQuery.get(url, {"id": 2}, function (res) {
            console.info(res);
        }, "json");


        var url = "http://localhost:8081/file/download"
        jQuery.get(url, {"id":10}, function (res) {
            debugger;
            console.info(res);
        },function(res) {
            debugger;
            console.error(res);
        }, "json");

    }
</script>
</body>
</html>